import React from "react"
import "./squares.css"

class Square extends React.Component{
    constructor(){
        super()
    }
    handleClick(e){
        this.props.handleClick(this.props.index)
    }
    render() {
        return (
            <>
                <div className = {this.props.winnerArr.includes(this.props.index)?"square red":"square" }
                     onClick={(e)=>{this.handleClick(e)}}>{this.props.value}
                </div>
            </>
        )
    }
}
export default Square